const path = require('path');
const fs = require('fs');
const gltfPath = path.join(process.cwd(),process.argv[process.argv.length-1]);
fs.readFile(gltfPath,{encoding:'utf-8'},(err, data)=>{
    if(err){
        throw err;
    }else{
        fs.writeFile(
            gltfPath,
            data.replace(/S8S_v3d/g,'TENCENT_THREE')
            .replace(/(Verge3D|v3d)_/g,'THREE_')
            .replace(/Soft8Soft Verge3D/g,'THREE'),
            (err)=>{
                if(err) throw err;
                console.log('done');
            }
        );
    }
})